import pytest

from pages.page_background_login import BackLogin
from pages.page_limit_affirm import LimitAffirm
from tools import DriverTools


@pytest.fixture(scope="function",autouse=False)
def open_close_calc():
    def setup_method(self):
        dr = DriverTools.get_driver()
        login_page = BackLogin(dr)
        login_page.open_url()
        login_page.back_login()
        self.open_account = LimitAffirm(dr)

    def teardown_method(self):
        DriverTools.quit_driver()